<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>dropdown</title>
  <style>
    html, body {
      margin: 0;
      padding: 50px 100px;
    }
    ul, li, p {
      list-style: none;
      padding: 0;
      margin: 0;
    }
    .desc {
      font-size: 14px;
      color: #666;
    }
    .drop-down-button {
      position: relative;
      display: inline-block;
      border: 1px solid #dadada;
      background-color: #fafafa;
      border-radius: 5px;
      color: #4c4c4b;
      padding: 2px 50px;
      cursor: pointer;
      text-align: center;
      font-size: 14px;
    }
    .drop-down-button:hover {
      border-color: #4c4c4b;
      background-color: #fff;
    }
    .drop-down-list {
      display: none;
      position: absolute;
      left: 0;
      padding: 10px 0;
      width: 100%;
    }
    .drop-down-button:hover .drop-down-list {
      display: block;
    }
    .drop-down-item {
      width: 100%;
      border-radius: 2px;
      margin-bottom: 3px;
      border: 1px solid #dadada;
      background-color: #fafafa;
      color: #4c4c4b;
      transition: all 0.1s;
    }
    .drop-down-item:hover {
      background-color: #4c4c4b;
      color: #fafafa;
    }
    .drop-down-item:active {
      color: #ffe300;
    }
  </style>
</head>
<body>

  <div class="desc">
    <p>重点: </p>
    <p>
      ”子绝父相“: 父元素相对定位, 子元素绝对定位.
    </p>
    <br>
    <p>
      Tip: 此demo中有伪元素(例: “:hover", ":active”), 可以学习一下.
    </p>
  </div>

  <hr>

  <div class="drop-down-button">
    <span>选择</span>
    <ul class="drop-down-list">
      <li class="drop-down-item">宙斯</li>
      <li class="drop-down-item">波塞冬</li>
      <li class="drop-down-item">雅典娜</li>
      <li class="drop-down-item">阿芙罗狄忒</li>
      <li class="drop-down-item">阿尔忒弥斯</li>
      <li class="drop-down-item">阿瑞斯</li>
      <li class="drop-down-item">狄奥尼索斯</li>
      <li class="drop-down-item">赫尔墨斯</li>
      <li class="drop-down-item">德墨忒斯</li>
    </ul>
  </div>
</body>
</html>